Skip to content

fix(activity-feed-v2): load full assignee list when expanding task assignees#4721

Open
zhirongwang wants to merge 7 commits into
box:masterfrom
zhirongwang:fix/activity-feed-v2-load-all-assignees
Open

fix(activity-feed-v2): load full assignee list when expanding task assignees#4721
zhirongwang wants to merge 7 commits into
box:masterfrom
zhirongwang:fix/activity-feed-v2-load-all-assignees

Conversation

@zhirongwang

@zhirongwang zhirongwang commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Tasks with more than 20 assignees only ever displayed the first page returned by the file activities endpoint: the assignee list's "Show more" button expanded the already-loaded entries but never fetched the rest, so the list appeared stuck at 20.
  • transformTaskToProps already set hasNextPage from assigned_to.next_marker, but no consumer supplied the onLoadAllAssignee callback that AssigneeList (from @box/activity-feed) needs to fetch the remaining assignees.
  • Wire onLoadAllAssignee through ActivityFeedV2FeedItemRowActivityFeed.List.Task, reusing the existing getTaskCollaborators fetch (/undoc/tasks/{id}/task_collaborators?role=ASSIGNEE&limit=1000) that the task edit modal already uses. This matches the legacy task card's expand behavior (activity-feed/task-new/Task.js).
  • Extract the assignee mapping into transformTaskAssignees so the initial transform and the load-all path share the same logic.

Test Plan

  • Unit tests added: FeedItemRow passes the original task to onTaskLoadAllAssignees and omits onLoadAllAssignee when no loader is provided; ActivityFeedV2 fetches via getTaskCollaborators and returns transformed assignees, and omits the loader when the prop is absent (all 237 tests in the three touched suites pass)
  • tsc and eslint clean
  • Verified in Storybook (Elements/ContentSidebar with live token) and in a linked webapp: clicking "Show more" on a 26-assignee task fires the task_collaborators?role=ASSIGNEE&limit=1000 request and renders all 26 assignees with loading state; "Show less" collapses back

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Activity feed task rows can now load and display the full assignee list when additional assignees are available beyond the initial preview.
    • Loaded assignee details (names, avatars, permissions, statuses, and completed time) are rendered consistently.
  • Bug Fixes

    • Improved handling for paginated or incomplete assignee data, including proper error handling when assignee loading fails.
  • Tests

    • Added/extended coverage for loading all assignees, avatar URL resolution, and error/no-callback scenarios.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 55d49fc4-1b0e-436f-b7dd-a5099ea116f3

📥 Commits

Reviewing files that changed from the base of the PR and between ffd2abd and e88c508.

📒 Files selected for processing (2)
  • src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx
  • src/elements/content-sidebar/activity-feed-v2/__tests__/ActivityFeedV2.test.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx
  • src/elements/content-sidebar/activity-feed-v2/tests/ActivityFeedV2.test.tsx

Walkthrough

Task assignee transformation is extracted into a reusable helper, then connected from ActivityFeedV2 through FeedItemRow to task entries. Tests verify complete-assignee loading, avatar resolution, error propagation, timestamp conversion, callback forwarding, and omission when unavailable.

Changes

Task assignee loading

Layer / File(s) Summary
Assignee transformation contract
src/elements/content-sidebar/activity-feed-v2/transformers.ts
Exports transformTaskAssignees and reuses it from transformTaskToProps to produce normalized assignee props.
Adapter callback wiring
src/elements/content-sidebar/activity-feed-v2/ActivityFeedV2.tsx, src/elements/content-sidebar/activity-feed-v2/FeedItemRow.tsx
Fetches complete collaborators through getTaskCollaborators, resolves missing avatars, transforms them, and forwards the loader to task entries.
Assignee loading validation
src/elements/content-sidebar/activity-feed-v2/__tests__/*
Verifies pagination flags, transformed collaborator results, avatar fallbacks, callback forwarding, error propagation, and callback omission.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ActivityFeedListTask
  participant FeedItemRow
  participant ActivityFeedV2
  participant getTaskCollaborators
  ActivityFeedListTask->>FeedItemRow: invoke onLoadAllAssignee(task)
  FeedItemRow->>ActivityFeedV2: invoke onTaskLoadAllAssignees(task)
  ActivityFeedV2->>getTaskCollaborators: fetch complete collaborators
  getTaskCollaborators-->>ActivityFeedV2: return collaborator entries
  ActivityFeedV2-->>ActivityFeedListTask: return transformed assignees
Loading

Possibly related PRs

Suggested labels: ready-to-merge

Suggested reviewers: jchan106, kduncanhsu, jmcbgaston

Poem

I’m a rabbit with assignees to load,
Hopping callbacks down the code road.
Avatars sparkle, names align,
Tests guard every hop in line.
The full list arrives with care—
A fluffy flow beyond compare!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: loading the full assignee list for expanded task assignees.
Description check ✅ Passed The description covers the main change and includes a concrete test plan, which is sufficient despite not mirroring the template comment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


zhirongwang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@zhirongwang zhirongwang self-assigned this Jul 24, 2026
@zhirongwang
zhirongwang marked this pull request as ready for review July 24, 2026 00:31
@zhirongwang
zhirongwang requested review from a team as code owners July 24, 2026 00:31
zhirongwang and others added 6 commits July 23, 2026 17:31
… fallback

Co-authored-by: Cursor <cursoragent@cursor.com>
…gnees' into fix/activity-feed-v2-load-all-assignees
Co-authored-by: Cursor <cursoragent@cursor.com>
… lookups

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants